package cn.snmp.mutual.uk.stack;

import java.io.*;

public class DefaultTrapContext extends ListeningContext {
    private static final String version_id = "@(#)$Id: DefaultTrapContext.java,v 3.12 2009/03/05 13:12:50 birgita Exp $ Copyright Westhawk Ltd";
    private static DefaultTrapContext current;

    protected DefaultTrapContext(final int port) throws IOException {
        this(port, "Standard");
    }

    protected DefaultTrapContext(final int port, final String typeSocketA) throws IOException {
        super(port, typeSocketA);
    }

    public static synchronized DefaultTrapContext getInstance(final int port) throws IOException {
        if (DefaultTrapContext.current == null) {
            DefaultTrapContext.current = new DefaultTrapContext(port);
        }
        return DefaultTrapContext.current;
    }

    public static synchronized DefaultTrapContext getInstance(final int port, final String typeSocketA) throws IOException {
        if (DefaultTrapContext.current == null) {
            DefaultTrapContext.current = new DefaultTrapContext(port, typeSocketA);
        }
        return DefaultTrapContext.current;
    }

    static {
        DefaultTrapContext.current = null;
    }
}
